
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="renderer" content="webkit">
        <meta charset="utf-8">
        <meta name="baidu-site-verification" content="DLH0DxvBfi">
        <title>自治区机动车尾气检测平台</title> 
        <link rel="shortcut icon" href="${WEB_PATH}/resources/img/icon/jcxxpt.ico">
      	<link href="${WEB_PATH}/resources/css/web/login.css?v=4.0.0" rel="stylesheet"> 
      	<#import "/common/import.ftl" as import>
    	<@import.loginImport/>
    	<style>
			/* CSS Document */
			body,h1,h2,h3,h4,h5,h6,hr,p,blockquote,dl,dt,dd,ul,ol,li,pre,form,fieldset,legend,button,input,textarea,th,td,div,span{
				margin: 0;
				padding: 0;
			}
			html{width:100%;height:100%;}
			body{width:100%;min-width:1024px;height:100%;background:#fcfcfc;}
			.mgnc{margin:0 auto;}
			.pr{position:relative;	}
			.fl{float:left; 	}
			.fr{float:right;}
			.cb{clear:both;}
			.w{width:100%;}
			.w80{width:80%;}
			.mt20{margin-top:20px;}
			.mt30{margin-top:30px;}
			.leftbg{
				width:53.5em;
				background:url(${WEB_PATH}/resources/img/bg.png) no-repeat left 1em;
				height:33.5625em;
			}
			.loginbox{
				margin-top: 5.5em;
				width: 360px;
				height:auto;
				background: rgba(255,255,255,1);
				border-radius: 8px;
				left: 0;
				right: 0;
				top: 200px;
				margin: auto;
				position: relative;
				border: 1px solid #e4eaee;
				-webkit-box-shadow: 0 0 5px #eaeaea;
				-moz-box-shadow: 0 0 5px #eaeaea;
				box-shadow: 0 0 5px #eaeaea;
			}
			.fontyahei{
				font-family:"微软雅黑";
			}
			.fontyaheilight{
				font-family:"微软雅黑 Light";
			}
			.letterspace1{letter-spacing:1px;}
			.colorgray{    color: #01943a;}
			.text1{
				height:35px;
				line-height:35px;
				border:1px solid #ccc;
				color:#999;
				font-size:15px;
				background-color:#fff;
			}
			.username{
				margin-top:15px;
				width:265px;
				background:url(${WEB_PATH}/resources/img/account.png) no-repeat left center;
				text-indent:35px;
				*float:left !important;
			}
			.psw{
				margin-top:15px;
				width:265px;
				background:url(${WEB_PATH}/resources/img/psw.png) no-repeat left center;
				text-indent:35px;
				*float:left !important;
			}
			.authcode{
				margin-top:15px;
				width:166px;
				background:url(${WEB_PATH}/resources/img/auth.png) no-repeat left center;
				text-indent:35px;
				float:left;
			}
			#img{
				margin-top:16px;
				height:30px;
				line-height:35px;
				float:left;
				margin-left:10px;
			}
			.btn1{
				width:131px;
				height:40px;
				border:none;
				background:none;
				font-family:"微软雅黑";
				font-size:18px;
				color:#fff;
				text-align:center;
				line-height:40px;
				cursor:pointer;
			}
			.bglogin{background-color: #01943a;}
			.bgreset{background-color:#1ea7df;}
			.footer{
				position: absolute;
				width:100%;
				height:60px;
				font-size:13px;
				font-family:"Adobe 黑体 Std R";
				background-color:#424242;
				color:#fff;
				text-align:center;
				line-height:60px;
			}
			.header{height: 65%; overflow: hidden;     border-radius: 0 0 50% 50%; width: 100%; margin-top:-10%;    position: relative;}
			#foot {
				background: #f5f6f5;
				border-top: 1px solid #ebebeb;
				text-align: left;
				height: 42px;
				line-height: 42px;
				margin-top: 40px;
				bottom: 0;
				position: fixed;
				width: 100%;;
			}
			span{
				color: #777;
				padding: 0 15px;
				text-decoration: none;
				font-size: 12px;
			}
			.login_err_panel{
				text-align: center;
			}
			.err_tips{
				color:red;
			}
		</style>
    	
    	
    	
    <script>if(window.top !== window.self){ window.top.location = window.location;}</script>
    <script type="text/javascript">
    
    	document.onkeydown=function(event)
		{
			e = event ? event : (window.event ? window.event : null);
			if(e.keyCode==13){
				severCheck();
			}
		}
    
    	$(function(){
    		$("#verifyImg").on('click',function(){
    			$(this).attr("src","${WEB_PATH }/commonFtl/image.jsp?_="+new Date().getTime());
    		});
    		
    		$('#btn_reset').click(function() {
				$('#loginname').val('');
				$('#password').val('');
				$('#code').val('');
			})
    	});
	
		//服务器校验
		function severCheck(){
			
			if(check()){
				var ii = layer.load(); 
				var loginname = $("#loginname").val();
				var password = $("#password").val();
				var code = $("#code").val();
				$.ajax({
					url : '${WEB_PATH }/system/user/login.do',  
					cache : false,
					type : 'POST',
					data: {account: loginname, pass: password, code: code},
					success : function(result) { 
						var data = $.parseJSON(result);
						if(data.success == true){ 
							top.location.href="${WEB_PATH }/system/admin/index.do";
						}else{
						   $(".err_tips").text(data.msg);
						   $("#img").attr("src","${WEB_PATH }/commonFtl/image.jsp?_="+new Date().getTime());
							//layer.msg(data.msg);
						}
						layer.close(ii);
					},
					error: function(result) {
						showErrorMsg(result);
					}
				});
			}
		}
	
		 
		 
 
		//客户端校验
		function check() { 
			if ($("#loginname").val() == "") { 
				$(".err_tips").text("用户名不能为空!");
				//layer.tips('用户名不能为空!', '#loginname');
				$("#loginname").focus();
				return false;
			}  
			if ($("#password").val() == "") {
			    $(".err_tips").text("密码不能为空!");
 				//layer.tips('密码不能为空!', '#password');
				$("#password").focus();
				return false;
			}
			if ($("#code").val() == "") {
			    $(".err_tips").text("验证码不能为空!");
 				//ayer.tips('验证码不能为空!', '#code'); 
				$("#code").focus();
				return false;
			} 
			return true;
		}

	</script>
    	
    	
    </head>
    <body class="style-signin">
		 <div class="loginbox">
			 <div class="w80 mgnc" style="overflow: auto;  margin-bottom: 1rem;">
			 	 <img src="${WEB_PATH }/resources/img/login_bg.png" style="/* height: 109%; */display: block;/* float: left; */width: 100px;margin: 0 auto;">
				 <h2 class="fontyaheilight letterspace1 colorgray mt20" style="margin-top:0;height:2rem; line-height: 2rem; position: relative; text-align: center;">自治区机动车尾气检测平台</h2>
				 <div class="login_err_panel" style="" id="err"><i class="icon18_common error"></i><span class="err_tips"></span></div>
				 <div>
					 <input type="text" class="text1 username" id="loginname" value="admin" name="loginname" required="true" placeholder="用户名">
				 </div>
				 <div>
					 <input type="password" class="text1 psw" id="password" name="password" value="123456" required="true" placeholder="密码">
				 </div>
				 <div>
					 <input type="text" class="text1 authcode" id="code" name="code" maxlength="4" onkeypress="_submit()" required="true" placeholder="验证码">
					 <img id="img" src="${WEB_PATH }/commonFtl/image.jsp">
				 </div>
				 <div class="cb">
					 <input id="btn_login" type="button" class="letterspace1 mt30 btn1 bglogin fl" value="登陆" onclick="severCheck()">
					 <input id="btn_reset" type="button" class="letterspace1 mt30 btn1 bgreset fr" value="重置" onclick="">
				 </div>
			 </div>
		 </div>
	</body>
</html>